﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ctrHoiDap.ascx.cs" Inherits="TCHSHue.Modules.IndexControl.HoiDap.ctrHoiDap" %>
<script type="text/javascript">
    $(function () {
        var ckTableHoiDap = getCookie("tableHoiDap");
        if (ckTableHoiDap != null && ckTableHoiDap != "") {
            if (ckTableHoiDap == "true")
                $("#tableHoiDap").show();
            else
                $("#tableHoiDap").hide();
        }
        else {
            $("#tableHoiDap").show();
            setCookie("tableHoiDap", "true", 365);
        }
    });
    function showHide() {
        var ckTableHoiDap = getCookie("tableHoiDap");
        if (ckTableHoiDap != null && ckTableHoiDap != "") {
            if (ckTableHoiDap == "true") {
                $("#tableHoiDap").hide();
                setCookie("tableHoiDap", "false", 365);
            }
            else {
                $("#tableHoiDap").show();
                setCookie("tableHoiDap", "true", 365);
            }
        }
        else {
            $("#tableHoiDap").show();
            setCookie("tableHoiDap", "true", 365);
        }
    }
    function setCookie(c_name, value, exdays) {
        var exdate = new Date();
        exdate.setDate(exdate.getDate() + exdays);
        var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
        document.cookie = c_name + "=" + c_value;
    }
    function getCookie(c_name) {
        var i, x, y, ARRcookies = document.cookie.split(";");
        for (i = 0; i < ARRcookies.length; i++) {
            x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
            y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
            x = x.replace(/^\s+|\s+$/g, "");
            if (x == c_name) {
                return unescape(y);
            }
        }
    }
</script>
<div id="hoidap" class="inbox">
    <h3 class="tieude">
        Hỏi - Đáp</h3>
    <%--<table style="width: 100%">
        <tr>
            <td colspan="2" class="line">
            </td>
        </tr>
        <tr>
            <td style="text-align: right;">
                </td>
        </tr>
    </table><--%>
    <img title="Ẩn/Hiện" onclick="showHide();" src="../../../Style/Images/add.png" />
    <br />
    <table id="tableHoiDap">
        <tr>
            <td style="width: 25%">
                Họ tên(*)
            </td>
            <td>
                <asp:TextBox ID="txtHoTen" CssClass="textWidth" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Địa chỉ thường trú
            </td>
            <td>
                <asp:TextBox ID="txtDiaChi" CssClass="textWidth" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Email
            </td>
            <td>
                <asp:TextBox ID="txtEmail" CssClass="textWidth" runat="server"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmail"
                    ErrorMessage="*" ToolTip="Nhập email sai" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                Số điện thoại
            </td>
            <td>
                <asp:TextBox ID="txtSDT" CssClass="textWidth" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Chủ đề(*)
            </td>
            <td>
                <asp:TextBox ID="txtChuDe" CssClass="textWidth" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Nội dung hỏi(*)
            </td>
            <td>
                <asp:TextBox ID="txtNoiDung" TextMode="MultiLine" CssClass="noiDungHoiDap" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Mã xác nhận(*)
            </td>
            <td>
                <asp:Image ID="imgCaptcha" runat="server" />
                <br />
                <asp:TextBox ID="txtCaptcha" CssClass="txtCaptcha" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <br />
                <asp:Button ID="bntGoi" runat="server" Text="Gởi câu hỏi" OnClick="bntGoi_Click" />
            </td>
        </tr>
    </table>
    <div visible="false" class="ui-widget" id="thongBao" runat="server">
        <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
            <p>
                <span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <asp:Label ID="lbThongBao" runat="server" Text="Đã gởi câu hỏi thành công!"></asp:Label></p>
        </div>
    </div>
</div>
<br />
<div id="dshd" class="inbox">
    <h3 class="tieude">
        Danh sách các câu hỏi được trả lời</h3>
   <%-- <table style="width: 100%">
        <tr>
            <td colspan="2" class="line">
            </td>
        </tr>
    </table>--%>
    <br />
    <div class="modulContentRight" style="border: 1px solid #79B7E7; padding: 5px">
        <asp:TextBox CssClass="txtTKBieuMau" ID="txtTimKiem" runat="server" Width="425px" BorderStyle="None"></asp:TextBox>
        <asp:Button CssClass="timKiemBM" ID="bntTimKiem" runat="server" Text="Tìm" OnClick="bntTimKiem_Click" />
    </div>
    <br />
    <div id="dsHoiDap">
        <asp:DataList ID="ddlHoiDap" runat="server">
            <ItemTemplate>
                <table style="width: 100%">
                    <tr style="border: none">
                        <td style="border: none">
                            <img class="image_left" style="position: relative; width: 90px; height: 90px" src="../../../Style/Images/comment.jpg"
                                title="Hỏi đáp" alt="Ngày viết" />
                            <img style="position: relative;" src="../../../Style/Images/title.jpg" title="Chủ đề hỏi"
                                alt="Ngày viết" />
                            <asp:Label ID="Label3" runat="server" Style="font-weight: 700" Text='<%# Eval("chuDe") %>'></asp:Label>
                            <br />
                            <img style="position: relative; top: 2px;" src="../../../Style/Images/user-small.png"
                                title="Người hỏi" alt="Ngày viết" />
                            <asp:Label ID="Label1" runat="server" CssClass="tacGia" Text='<%# Eval("hoTenNguoiHoi") %>'></asp:Label>
                            <img style="position: relative; top: 2px;" src="../../../Style/Images/calendar-small.png"
                                title="Ngày hỏi" alt="Ngày viết" />
                            <asp:Label ID="Label5" runat="server" CssClass="tacGia" Text='<%# Eval("strNgayHoi") %>'></asp:Label>
                            <br />
                            <img style="position: relative;" src="../../../Style/Images/question.png" title="Nội dung hỏi"
                                alt="Ngày viết" />
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("noiDungCauHoi") %>'></asp:Label>
                            <br />
                            <asp:Label ID="Label4" runat="server" Text='<%# "<b>Trả lời: </b>" + Eval("noiDungTraLoi") %>'></asp:Label>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </asp:DataList>
    </div>
    <br />
    <div id="divPaging" runat="server" style="text-align: center; margin-top: 5px;">
    </div>
</div>
